<?php
/**
 * @copyright  For copyright and license information, read the COPYING.txt file.
 * @link       /COPYING.txt
 * @license    Academic Free License (AFL 3.0)
 * @package     base_default
 */

/** @var Mage_Catalog_Block_Product_View $this */
?>

<?php $_product = $this->getProduct(); ?>

<ul class="add-to-links">
<?php if ($this->helper('wishlist')->isAllow()) : ?>
    <li>
        <a href="#"
           onclick="customFormSubmit(
                   '<?php echo $this->helper('wishlist')->getAddUrlWithCustomParams($_product, [], false) ?>',
                   '<?php echo $this->escapeHtml(json_encode(['form_key' => $this->getFormKey()])) ?>',
                   'post')"
           class="link-wishlist">
            <?php echo $this->__('Add to Wishlist') ?>
        </a>
    </li>
<?php endif ?>
<?php
    $_compareUrl = $this->helper('catalog/product_compare')->getAddUrlCustom($_product, false);
?>
<?php if($_compareUrl) : ?>
    <li>
        <span class="separator">|</span>
        <a href="#"
           class="link-compare"
           onclick="customFormSubmit(
                   '<?php echo $_compareUrl ?>',
                   '<?php echo $this->escapeHtml(json_encode(['form_key' => $this->getFormKey()])) ?>',
                   'post')">
            <?php echo $this->__('Add to Compare') ?>
        </a>
    </li>
<?php endif ?>
</ul>
